<template>
	<view class="container ptb_8 plr_16">
		<view class="pl_16 pr_12 ptb_18 br_8 fc_fff fx aic jcb"
			style="background: #303133;">
			<view>
				<view>
					金豆余额
				</view>
				<view class="mt_2 fz_20 fb">
					{{dataInfo.youJiaBalance||0}}金豆
				</view>
				<view class="mt_2 fz_12">
					另有{{dataInfo.youJiaWithdraw||0}}金豆提现中
				</view>
			</view>
			<button class="custom_btn fz_12 lh_33 plr_12 br_30"
				style="background: linear-gradient(180deg, #FFE4BF 0%, #FFFFFF 100%);color: #A5640C;" @click="handleWithdraw">金豆提现</button>
		</view>
		<view class="mt_12 br_8 bc_fff fc_666">
			<navigator hover-class="none" class="p_12 fx aic jcb" url="/pages/person/pages/record?type=coin">
				金豆明细
				<u-icon name="arrow-right" color="#ccc" size="32rpx"></u-icon>
			</navigator>
			<navigator hover-class="none" class="p_12 fx aic jcb" url="/pages/person/pages/withdraw_record">
				提现明细
				<u-icon name="arrow-right" color="#ccc" size="32rpx"></u-icon>
			</navigator>
		</view>
	</view>
</template>

<script>
	import api from '@/service/config/api'
	export default {
		data() {
			return {
				dataInfo: {}
			}
		},
		onShow() {
			this.getData()
		},
		methods: {
			getData() {
				this.$utils.loading()
				api.get('/user/api/myLegumes').then(res => {
					this.dataInfo = res.data
				})
			},
			handleWithdraw() {
				uni.navigateTo({
					url: '/pages/person/pages/coin_withdraw'
				})
			}
		},
	}
</script>

<style lang="scss">
	.container {}
</style>